package com.qf.test;

import com.qf.bean.Users;
import com.qf.web.StudentServlet;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 2019/11/11
 * Administrator
 * spring1111
 * 面向对象面向君  不负代码不负卿
 */
public class Demo2 {
    public static void main(String[] args) {
      //直接获得spring容器中的对象
          //1.加载spring配置文件
        ApplicationContext app= new ClassPathXmlApplicationContext("spring1112.xml");
        Users u1 =(Users) app.getBean("u4");
        System.out.println(u1.getName());
        System.out.println(u1.getGrade().getGname());

    }
}
